@import "../../global";

// 混合
.steps-icon(@color, @img, @site: 0) {
  .steps span {
    .StepsIcon(4);
  }

  .steps-hr .this {
    left: @site;
  }
}

//循环
.StepsIcon(@i) when (@i > 0) {
  &:nth-child(@{i}) {
    color: extract(@color, @i);

    &::before {
      .backgroundcard(extract(@img, @i));
    }
  }

  .StepsIcon(@i - 1);
}

.backgroundcard(@img) {
  background: url("../../assets/@{img}.png") no-repeat center;
  background-size: cover;
}

// 内容样式开始
.deployment-create {
  .steps-content {
    margin-top: 30px;
  }

  .steps-action {
    .ant-btn {
      margin-top: 36px;
      height: 45px;
      width: 200px;
      font-size: 16px;
      font-weight: bold;
      color: #737373;
      background-color: #e5e5e5;
    }

    .ant-btn-primary {
      color: white;
      background-color: #38a2ec;
    }

    // .ant-btn-primary {
    //   color: #737373;
    //   background-color: #E5E5E5;
    // }
  }

  // 容器
  .cont {
    padding-top: 40px;
  }

  // 步骤条
  .header-steps {
    .steps {
      span {
        position: relative;
        display: inline-block;
        text-align: center;
        padding-bottom: 18px;
        width: 25%;
        color: @font-color;
        #font(17px);

        &:nth-child(1)::before,
        &:nth-child(2)::before,
        &:nth-child(3)::before,
        &:nth-child(4)::before {
          content: "";
          position: absolute;
          right: 50%;
          bottom: -20px;
          height: 30px;
          width: 30px;
          transform: translateX(50%);
          z-index: 2;
        }
      }
    }

    .steps-hr {
      height: 10px;
      border-radius: 10px;
      background-color: #becede;
      overflow: hidden;

      .this {
        position: relative;
        display: block;
        left: 0;
        width: 25%;
        height: 10px;
        border-radius: 10px;
        background: url("../../assets/steps.jpg");
        background-size: cover;
        transition: left 0.2s;
      }
    }

    // 切换效果
    &.one {
      @color: @blue,
      @font-color,
      @font-color,
      @font-color;

      @img: "one-a",
      "two",
      "three",
      "four";
      .steps-icon(@color, @img, 0)
    }

    &.two {
      @color: @font-color,
      @blue,
      @font-color,
      @font-color;

      @img: "one",
      "two-a",
      "three",
      "four";
      .steps-icon(@color, @img, 25%)
    }

    &.three {
      @color: @font-color,
      @font-color,
      @blue,
      @font-color;

      @img: "one",
      "two",
      "three-a",
      "four";
      .steps-icon(@color, @img, 50%)
    }

    &.four {
      @color: @font-color,
      @font-color,
      @font-color,
      @blue;

      @img: "one",
      "two",
      "three",
      "four-a";
      .steps-icon(@color, @img, 75%)
    }
  }
}

//===================================
// 组件样式
//===================================
//应用配置
.create-application {
  //节点亲和
  .node {
    .node-question {
      position: relative;
      display: inline-flex;
      align-items: center;
      margin-bottom: 10px;
      margin-left: 80px;
      height: 40px;
      color: @blue;
      font-size: 20px;
      cursor: pointer;

      &:hover::after {
        content: "根据标签值将容器应用部署到相同的节点。第一个应用任意部署，第二个应用寻找第一个应用的部署位置进行部署。";
        position: absolute;
        left: 25px;
        top: -25px;
        padding: 10px 28px;
        width: 335px;
        height: 70px;
        color: @font-color;
        font-size: 12px;
        line-height: 16px;
        text-align: left;
        background: url("../../assets/node-question.png") no-repeat center;
        background-size: cover;
      }
    }
  }

  // 单行样式
  section {
    position: relative;

    // 实例数量
    .replicas {
      position: absolute;
      bottom: 0;
      left: 645px;
      display: flex;
      white-space: nowrap;
      justify-content: center;
      align-items: center;
      left: 645px;
      width: 200px;

      .container-title {
        margin: 0;
      }
    }
  }
}

//===================================
//容器配置
.create-container {
  .collapse(@color) {
    border: 1px solid @color;
    transition: border 0.5s;
  }

  .advanced-paralleling {
    padding-left: 90px;
  }

  // 高级配置
  .advanced {
    .ant-collapse-content {
      margin-bottom: 17px;
      margin-top: -5px;
      line-height: 50px;
      .collapse(@border-color);
    }

    .advanced-cont {
      input {
        background-color: transparent;
      }

      .advanced-cont-add {
        display: inline-block;
        cursor: pointer;
        color: #3cb4f8;

        > button {
          color: #3cb4f8;
          border: none;
        }
      }

      .liveness-title {
        position: absolute;
        margin-top: 5px;
        font-size: 16px;
        font-weight: 400;
        color: #343434;
      }

      // 健康检测
      .liveness-probe {
        margin-bottom: 15px;
        margin-left: 110px;
        padding: 0 22px;
        background-color: #f8f8f8;

        .container-row{
          padding: 0;
          &.probe-title {
            height: 60px;
            align-items: center;
            padding-bottom: 0;
          }
        }

        .container-title {
          display: inline-table;
          padding: 0;
          margin: 0;
          height: 60px;
          width: 117px;
          text-align: right;
          font-size: 14px;
          font-weight: 400;
          line-height: 60px;
        }

        .container-cont {
          height: 40px;
          line-height: 40px;
          background-color: white;
        }

        .container-row {
          display: flex;
          white-space: nowrap;
        }

        .container-row.probe-title > .container-cont {
          background-color: transparent;
        }
      }
    }

    // 手风琴样式更改
    .ant-collapse-item .ant-collapse-header {
      margin-bottom: 10px;
      padding: 0 40px;
      line-height: 38px;
      background-color: #f6fbfe;
      border: 1px solid #bee1f9;
      transition: border 0.5s;
      color: @font-strong;
    }
  }

  // 容器规格
  .conts {
    // 类型
    .conts-type {
      margin-left: 90px;
      margin-bottom: 17px;

      .ant-radio-button-wrapper {
        margin-right: 22px;
        margin-bottom: 16px;
        height: 40px;
        width: 140px;
        color: #a7a7a7;
        text-align: center;
        line-height: 40px;
      }

      .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
        color: #01a2ea;
        border-color: #0fbdf4;
      }
    }

    //cpu
    .conts-cpu {
      width: 640px;
      max-width: 100%;
    }
  }

  .image .ant-radio-group {
    display: flex;
    align-items: center;
    height: 40px;
    margin-left: 90px;
  }

  // 添加数据表单
  .ant-empty {
    display: none;
  }

  .ant-table-cell {
    padding: 0;
    height: 40px;
    white-space: nowrap;
  }

  .ant-table-tbody > tr > td {
    text-align: center;

    input {
      text-align: center;
    }

    // .ant-select-selector {
    //   border-color: white;
    // }
    .ant-select-arrow {
      border-left: none;
    }
  }
}

.ant-table-thead > tr > th {
  padding: 0;
  height: 40px;
  width: 170px;
  text-align: center;
  color: white;
  background-color: #cfcfcf;
  border: none;
}

.ant-table.ant-table-bordered
  > .ant-table-container
  > .ant-table-content
  > table
  > thead
  > tr
  > th {
  text-align: center;
  border-color: #cfcfcf;
}

//修改table内容颜色
.ant-table-content td {
  color: @font-color;
  #font(14px);
}

//===================================
//应用配置
.create-specification {
  .advanced {
    margin-top: 38px;
    display: flex;

    strong {
      white-space: nowrap;
    }
  }

  .content {
    margin-bottom: 22px;
    padding: 18px 35px 14px 20px;
    background-color: #fafafa;

    // 描述列表
    .ant-descriptions-row > td {
      padding: 22px 25px;
      background-color: white;
      border: 1px solid #dedede;

      .ant-descriptions-item-label {
        color: @font-strong;
        #font(14px, bold);
      }

      .ant-descriptions-item-content {
        color: @font-color;
        #font(14px);
      }
    }
  }

  // 手风琴样式更改
  .ant-collapse-item .ant-collapse-header {
    margin-bottom: 10px;
    padding: 0 40px;
    line-height: 38px;
    background-color: #f6fbfe;
    border: 1px solid #bee1f9;
    color: @font-strong;
  }

  .ant-collapse > .ant-collapse-item {
    border-bottom: none;
  }
  .ant-collapse {
    width: 100%;
    border: none;
  }

  .ant-collapse-content {
    border-top: none;
    margin-bottom: 17px;
    margin-top: -5px;
    border: 1px solid @border-color;
  }
}

//===================================
//创建完成
.create-finish {
  display: flex;
  flex-flow: column;
  align-items: center;
  padding-top: 20px;

  .finish {
    max-width: 100%;
    width: 820px;
    height: 480px;
    border: 1px solid @border-color;

    .finish-title {
      position: relative;
      display: flex;
      flex-flow: column;
      justify-content: center;
      padding-right: 125px;
      padding-left: 230px;
      height: 150px;

      img {
        position: absolute;
        left: 125px;
        height: 73px;
        width: 73px;
      }

      strong {
        display: inline-block;
        margin-bottom: 13px;
        color: @font-title;
        #font(24px, bold);
      }

      p {
        margin: 0;
        color: @font-gray;
      }
    }

    .finish-cont {
      padding-right: 125px;
      padding-top: 42px;
      padding-left: 230px;
      height: 328px;
      background-color: #fafafa;
      overflow-y: scroll;

      strong {
        display: inline-block;
        margin-bottom: 30px;
        #font(20px, bold);
      }

      ul {
        list-style-type: none;
        padding-left: 0;

        .finish-cont-list {
          position: relative;
          margin-bottom: 8px;

          &::before {
            content: "";
            position: absolute;
            top: 6px;
            left: -23px;
            height: 10px;
            width: 10px;
            border-radius: 50%;
            background-color: @blue;
          }

          .time {
            color: @font-color;
          }

          .text {
            margin-left: 62px;
            color: @font-strong;
          }
        }
      }
    }
  }
}
